package ast;

public class NewConstP extends Process {

	private Constant constant;
	private Process process;
	
	public NewConstP(Constant cst, Process proc)
	{
		constant = cst;
		process = proc;
	}
	
	public Constant getConstant()
	{
		return constant;
	}
	
	public Process getProcess()
	{
		return process;
	}
	
	public void setProcess(Process p)
	{
		process = p;
	}
	
	public String toString(int indent)
	{
		String res = "";
		res += "(new " + constant + " : ";
		if (constant instanceof DataConstant) {
			res += "Dt";
			indent += 2;
		} else {
			Label lb = ((ChannelConstant) constant).getLabel();
			res += lb;
			indent += lb.toString().length();
		}
		res += ")." + process.toString(0);
				
		return res;
	}
}
